<% layout('/layouts/default.html', {title: 'pt_shichang_buzhou管理', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header" style="display: block!important;">
			<div class="box-title">
			</div>
			<div class="box-tools pull-right" >
				<a href="${ctx}/pt/ptShichangBuzhou/form?shichangId=${ptShichangBuzhou.shichangId}" class="btn btn-default btnTool" title="${text('新增')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
			</div>
		</div>
		<div class="box-body">
			<#form:form id="searchForm" model="${ptShichangBuzhou}" action="${ctx}/pt/ptShichangBuzhou/listData" method="post" class="form-inline hide"
					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
				<#form:hidden path="shichangId"/>
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
					<button type="reset" class="btn btn-default btn-sm isQuick">${text('重置')}</button>
				</div>
			</#form:form>
			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [
		{header:'${text("序号")}', name:'xuhao', index:'a.xuhao', width:150, align:"center"},
		{header:'${text("图片")}', name:'pic', index:'a.pic', width:150, align:"left", formatter: function(val, obj, row, act){
			return '<img src="'+val+'" style="width: 50px;height: 50px;"/>';
		}},
		{header:'${text("说明")}', name:'text', index:'a.text', width:150, align:"left"},
		{header:'${text("操作")}', name:'actions', width:120, formatter: function(val, obj, row, act){
			var actions = [];
			actions.push('<a href="${ctx}/pt/ptShichangBuzhou/form?id='+row.id+'" class="btnList" title="${text("编辑")}"><i class="fa fa-pencil"></i></a>&nbsp;');
			actions.push('<a href="${ctx}/pt/ptShichangBuzhou/delete?id='+row.id+'" class="btnList" title="${text("删除")}" data-confirm="${text("确认要删除吗？")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
			return actions.join('');
		}}
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});
</script>